<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <div>{{name | upper}}</div>
    <div>{{num | lower}}</div>
  </div>
  <script src="../vue.js"></script>
  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        name: 'tom',
        num: 'JERRY'
      },
      methods: {

      },
      filters: {
        upper: function (el) {
          return el.charAt(0).toUpperCase() + el.slice(1)
        },
        lower: function (el) {
          return el.charAt(0).toLowerCase() + el.slice(1)
        }
      }
    })
  </script>
</body>

</html>